package com.ruoyi.coal.modules.coalpile.controller;

import com.ruoyi.coal.common.utils.R;
import com.ruoyi.coal.modules.coalpile.domain.vo.CoalPileSiloVo;
import com.ruoyi.coal.modules.coalpile.domain.vo.CoalYardVo;
import com.ruoyi.coal.modules.coalpile.service.CoalYardHistoryService;
import com.ruoyi.coal.modules.coalpile.service.CoalYardInfoService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "CoalpileSilo", tags = {"筒仓展示"})
@RestController
@RequestMapping({"/coalpile/coalpileSilo"})
@DataSource(value = DataSourceType.SLAVE)
public class CoalPileSiloController {
    @Autowired
    private CoalYardInfoService coalYardInfoService;

    @Autowired
    private CoalYardHistoryService coalYardHistoryService;

    @GetMapping({"/coallist"})
    @ApiOperation(value = "煤场列表", tags = {"煤场列表"})
    public R coallist() {
        List<CoalYardVo> CoalIdList = this.coalYardInfoService.getCoalIdList();
        return R.ok().put("data", CoalIdList);
    }

    @PostMapping({"/silodisplay"})
    @ApiOperation(value = "煤堆比较", tags = {"煤堆比较"})
    public R silodisplay() {
        List<CoalPileSiloVo> vos = this.coalYardHistoryService.silodisplay();
        return R.ok().put("data", vos);
    }
}
